/*******************
Use of Content Categories
*********************/

clear 
*change directory to "....\Data\"
*cd 
set more off 

/***********************
Models & Marginal Effects
************************/

*************Programmatic
clear 
use "extreme_programmatic_long.dta"

*****Cleaning
label var id "ID"

label var too_extreme_1 "Both Parties Too Extreme"
label var knowl_mean "Political Knowledge"
label var opinionation "Opinionation"
label var pid_3 "Partisanship"
label var op_ideol_cons "Issue Consistency"
label var ideol_ext "Ideological Extremity"
label var age "Age"
label var gender "Gender"
label var race1 "Race"
label var house_income "Household Income"

gen exp1_cyn = 0 
	replace exp1_cyn = 1 if gil_treat == "counter_lw" | gil_treat == "counter_rw"
label var exp1_cyn "Cynicism Treatment, Exp 1"

gen exp2_cyn = 0
	replace exp2_cyn = 1 if corker_treat == "counter_lw" | corker_treat == "counter_rw"
label var exp2_cyn "Cynicism Treatment, Exp 2"

label def cyntreat 1 "Cynicism Treatment" 0 "No Cynicism Treatment"
label values exp1_cyn exp2_cyn cyntreat

gen cyn1 = . 
	replace cyn1 = 1 if exp1_cyn == 0 & exp2_cyn == 0
	replace cyn1 = 2 if exp1_cyn == 1 | exp2_cyn == 1
	replace cyn1 = 3 if exp1_cyn == 1 & exp2_cyn == 1
label var cyn1 "Cynicism Treatment"
label def cynt1 1 "No Cynicism Treatment" 2 "One Cynicism Treatment" 3 "Two Cynicism Treatments"
label values cyn1 cynt1

label var party "Target Party"

****Model
eststo clear
eststo: logit outcome i.party i.pid_3 c.knowl_mean c.op_ideol_cons i.ideol_ext i.too_extreme_1 c.opinionation ///
				i.gender i.race1 i.educ c.age c.house_income i.cyn1, vce(cluster id)
	
	***Predicted Probability
		margins, at(knowl_mean=(0(0.25)1)) saving(program_probs, replace)
	
	***Marginal Effect of Knowledge
	margins, at( (p90) knowl_mean) at( (p10) knowl_mean) post coeflegend
	lincomest _b[1bn._at] - _b[2._at]
	parmest, label saving(program_margin.dta, replace)
	
	
*************Ideol
clear 
use "extreme_ideol_long.dta"

*****Cleaning
label var id "ID"

label var too_extreme_1 "Both Parties Too Extreme"
label var knowl_mean "Political Knowledge"
label var opinionation "Opinionation"
label var pid_3 "Partisanship"
label var op_ideol_cons "Issue Consistency"
label var ideol_ext "Ideological Extremity"
label var age "Age"
label var gender "Gender"
label var race1 "Race"
label var house_income "Household Income"

gen exp1_cyn = 0 
	replace exp1_cyn = 1 if gil_treat == "counter_lw" | gil_treat == "counter_rw"
label var exp1_cyn "Cynicism Treatment, Exp 1"

gen exp2_cyn = 0
	replace exp2_cyn = 1 if corker_treat == "counter_lw" | corker_treat == "counter_rw"
label var exp2_cyn "Cynicism Treatment, Exp 2"

label def cyntreat 1 "Cynicism Treatment" 0 "No Cynicism Treatment"
label values exp1_cyn exp2_cyn cyntreat

gen cyn1 = . 
	replace cyn1 = 1 if exp1_cyn == 0 & exp2_cyn == 0
	replace cyn1 = 2 if exp1_cyn == 1 | exp2_cyn == 1
	replace cyn1 = 3 if exp1_cyn == 1 & exp2_cyn == 1
label var cyn1 "Cynicism Treatment"
label def cynt1 1 "No Cynicism Treatment" 2 "One Cynicism Treatment" 3 "Two Cynicism Treatments"
label values cyn1 cynt1

label var party "Target Party"

****Model
eststo: logit outcome i.party i.pid_3 c.knowl_mean c.op_ideol_cons i.ideol_ext i.too_extreme_1 c.opinionation ///
				i.gender i.race1 i.educ c.age c.house_income i.cyn1, vce(cluster id)
	
	***Predicted Probability
		margins, at(knowl_mean=(0(0.25)1)) saving(ideol_probs, replace)
	
	***Marginal Effect of Knowledge
	margins, at( (p90) knowl_mean) at( (p10) knowl_mean) post coeflegend
	lincomest _b[1bn._at] - _b[2._at]
	parmest, label saving(ideol_margin.dta, replace)
	
	
*************Principles
clear 
use "extreme_principle_long.dta"

*****Cleaning
label var id "ID"

label var too_extreme_1 "Both Parties Too Extreme"
label var knowl_mean "Political Knowledge"
label var opinionation "Opinionation"
label var pid_3 "Partisanship"
label var op_ideol_cons "Issue Consistency"
label var ideol_ext "Ideological Extremity"
label var age "Age"
label var gender "Gender"
label var race1 "Race"
label var house_income "Household Income"

gen exp1_cyn = 0 
	replace exp1_cyn = 1 if gil_treat == "counter_lw" | gil_treat == "counter_rw"
label var exp1_cyn "Cynicism Treatment, Exp 1"

gen exp2_cyn = 0
	replace exp2_cyn = 1 if corker_treat == "counter_lw" | corker_treat == "counter_rw"
label var exp2_cyn "Cynicism Treatment, Exp 2"

label def cyntreat 1 "Cynicism Treatment" 0 "No Cynicism Treatment"
label values exp1_cyn exp2_cyn cyntreat

gen cyn1 = . 
	replace cyn1 = 1 if exp1_cyn == 0 & exp2_cyn == 0
	replace cyn1 = 2 if exp1_cyn == 1 | exp2_cyn == 1
	replace cyn1 = 3 if exp1_cyn == 1 & exp2_cyn == 1
label var cyn1 "Cynicism Treatment"
label def cynt1 1 "No Cynicism Treatment" 2 "One Cynicism Treatment" 3 "Two Cynicism Treatments"
label values cyn1 cynt1

label var party "Target Party"

****Model
eststo: logit outcome i.party i.pid_3 c.knowl_mean c.op_ideol_cons i.ideol_ext i.too_extreme_1 c.opinionation ///
				i.gender i.race1 i.educ c.age c.house_income i.cyn1, vce(cluster id)
	
	***Predicted Probability
		margins, at(knowl_mean=(0(0.25)1)) saving(princ_probs, replace)
	
	***Marginal Effect of Knowledge
	margins, at( (p90) knowl_mean) at( (p10) knowl_mean) post coeflegend
	lincomest _b[1bn._at] - _b[2._at]
	parmest, label saving(princ_margin.dta, replace)
	


*************Policy
clear 
use "extreme_policy_long.dta"

*****Cleaning
label var id "ID"

label var too_extreme_1 "Both Parties Too Extreme"
label var knowl_mean "Political Knowledge"
label var opinionation "Opinionation"
label var pid_3 "Partisanship"
label var op_ideol_cons "Issue Consistency"
label var ideol_ext "Ideological Extremity"
label var age "Age"
label var gender "Gender"
label var race1 "Race"
label var house_income "Household Income"

gen exp1_cyn = 0 
	replace exp1_cyn = 1 if gil_treat == "counter_lw" | gil_treat == "counter_rw"
label var exp1_cyn "Cynicism Treatment, Exp 1"

gen exp2_cyn = 0
	replace exp2_cyn = 1 if corker_treat == "counter_lw" | corker_treat == "counter_rw"
label var exp2_cyn "Cynicism Treatment, Exp 2"

label def cyntreat 1 "Cynicism Treatment" 0 "No Cynicism Treatment"
label values exp1_cyn exp2_cyn cyntreat

gen cyn1 = . 
	replace cyn1 = 1 if exp1_cyn == 0 & exp2_cyn == 0
	replace cyn1 = 2 if exp1_cyn == 1 | exp2_cyn == 1
	replace cyn1 = 3 if exp1_cyn == 1 & exp2_cyn == 1
label var cyn1 "Cynicism Treatment"
label def cynt1 1 "No Cynicism Treatment" 2 "One Cynicism Treatment" 3 "Two Cynicism Treatments"
label values cyn1 cynt1

label var party "Target Party"

****Model
eststo: logit outcome i.party i.pid_3 c.knowl_mean c.op_ideol_cons i.ideol_ext i.too_extreme_1 c.opinionation ///
				i.gender i.race1 i.educ c.age c.house_income i.cyn1, vce(cluster id)
	
	***Predicted Probability
		margins, at(knowl_mean=(0(0.25)1)) saving(policy_probs, replace)
	
	***Marginal Effect of Knowledge
	margins, at( (p90) knowl_mean) at( (p10) knowl_mean) post coeflegend
	lincomest _b[1bn._at] - _b[2._at]
	parmest, label saving(policy_margin.dta, replace)
	


*************Social Groups
clear 
use "extreme_sgroups_long.dta"

*****Cleaning
label var id "ID"

label var too_extreme_1 "Both Parties Too Extreme"
label var knowl_mean "Political Knowledge"
label var opinionation "Opinionation"
label var pid_3 "Partisanship"
label var op_ideol_cons "Issue Consistency"
label var ideol_ext "Ideological Extremity"
label var age "Age"
label var gender "Gender"
label var race1 "Race"
label var house_income "Household Income"

gen exp1_cyn = 0 
	replace exp1_cyn = 1 if gil_treat == "counter_lw" | gil_treat == "counter_rw"
label var exp1_cyn "Cynicism Treatment, Exp 1"

gen exp2_cyn = 0
	replace exp2_cyn = 1 if corker_treat == "counter_lw" | corker_treat == "counter_rw"
label var exp2_cyn "Cynicism Treatment, Exp 2"

label def cyntreat 1 "Cynicism Treatment" 0 "No Cynicism Treatment"
label values exp1_cyn exp2_cyn cyntreat

gen cyn1 = . 
	replace cyn1 = 1 if exp1_cyn == 0 & exp2_cyn == 0
	replace cyn1 = 2 if exp1_cyn == 1 | exp2_cyn == 1
	replace cyn1 = 3 if exp1_cyn == 1 & exp2_cyn == 1
label var cyn1 "Cynicism Treatment"
label def cynt1 1 "No Cynicism Treatment" 2 "One Cynicism Treatment" 3 "Two Cynicism Treatments"
label values cyn1 cynt1

label var party "Target Party"

****Model
eststo: logit outcome i.party i.pid_3 c.knowl_mean c.op_ideol_cons i.ideol_ext i.too_extreme_1 c.opinionation ///
				i.gender i.race1 i.educ c.age c.house_income i.cyn1, vce(cluster id)
	
	***Predicted Probability
		margins, at(knowl_mean=(0(0.25)1)) saving(sgroups_probs, replace)
	
	***Marginal Effect of Knowledge
	margins, at( (p90) knowl_mean) at( (p10) knowl_mean) post coeflegend
	lincomest _b[1bn._at] - _b[2._at]
	parmest, label saving(sgroups_margin.dta, replace)
	


*************Politicians
clear 
use "extreme_politicians_long.dta"

*****Cleaning
label var id "ID"

label var too_extreme_1 "Both Parties Too Extreme"
label var knowl_mean "Political Knowledge"
label var opinionation "Opinionation"
label var pid_3 "Partisanship"
label var op_ideol_cons "Issue Consistency"
label var ideol_ext "Ideological Extremity"
label var age "Age"
label var gender "Gender"
label var race1 "Race"
label var house_income "Household Income"

gen exp1_cyn = 0 
	replace exp1_cyn = 1 if gil_treat == "counter_lw" | gil_treat == "counter_rw"
label var exp1_cyn "Cynicism Treatment, Exp 1"

gen exp2_cyn = 0
	replace exp2_cyn = 1 if corker_treat == "counter_lw" | corker_treat == "counter_rw"
label var exp2_cyn "Cynicism Treatment, Exp 2"

label def cyntreat 1 "Cynicism Treatment" 0 "No Cynicism Treatment"
label values exp1_cyn exp2_cyn cyntreat

gen cyn1 = . 
	replace cyn1 = 1 if exp1_cyn == 0 & exp2_cyn == 0
	replace cyn1 = 2 if exp1_cyn == 1 | exp2_cyn == 1
	replace cyn1 = 3 if exp1_cyn == 1 & exp2_cyn == 1
label var cyn1 "Cynicism Treatment"
label def cynt1 1 "No Cynicism Treatment" 2 "One Cynicism Treatment" 3 "Two Cynicism Treatments"
label values cyn1 cynt1

label var party "Target Party"

****Model
eststo: logit outcome i.party i.pid_3 c.knowl_mean c.op_ideol_cons i.ideol_ext i.too_extreme_1 c.opinionation ///
				i.gender i.race1 i.educ c.age c.house_income i.cyn1, vce(cluster id)
	
	***Predicted Probability
		margins, at(knowl_mean=(0(0.25)1)) saving(polit_probs, replace)
	
	***Marginal Effect of Knowledge
	margins, at( (p90) knowl_mean) at( (p10) knowl_mean) post coeflegend
	lincomest _b[1bn._at] - _b[2._at]
	parmest, label saving(polit_margin.dta, replace)
	

*************Traits
clear 
use "extreme_traits_long.dta"

*****Cleaning
label var id "ID"

label var too_extreme_1 "Both Parties Too Extreme"
label var knowl_mean "Political Knowledge"
label var opinionation "Opinionation"
label var pid_3 "Partisanship"
label var op_ideol_cons "Issue Consistency"
label var ideol_ext "Ideological Extremity"
label var age "Age"
label var gender "Gender"
label var race1 "Race"
label var house_income "Household Income"

gen exp1_cyn = 0 
	replace exp1_cyn = 1 if gil_treat == "counter_lw" | gil_treat == "counter_rw"
label var exp1_cyn "Cynicism Treatment, Exp 1"

gen exp2_cyn = 0
	replace exp2_cyn = 1 if corker_treat == "counter_lw" | corker_treat == "counter_rw"
label var exp2_cyn "Cynicism Treatment, Exp 2"

label def cyntreat 1 "Cynicism Treatment" 0 "No Cynicism Treatment"
label values exp1_cyn exp2_cyn cyntreat

gen cyn1 = . 
	replace cyn1 = 1 if exp1_cyn == 0 & exp2_cyn == 0
	replace cyn1 = 2 if exp1_cyn == 1 | exp2_cyn == 1
	replace cyn1 = 3 if exp1_cyn == 1 & exp2_cyn == 1
label var cyn1 "Cynicism Treatment"
label def cynt1 1 "No Cynicism Treatment" 2 "One Cynicism Treatment" 3 "Two Cynicism Treatments"
label values cyn1 cynt1

label var party "Target Party"

****Model
eststo: logit outcome i.party i.pid_3 c.knowl_mean c.op_ideol_cons i.ideol_ext i.too_extreme_1 c.opinionation ///
				i.gender i.race1 i.educ c.age c.house_income i.cyn1, vce(cluster id)
	
	***Predicted Probability
		margins, at(knowl_mean=(0(0.25)1)) saving(traits_probs, replace)
	
	***Marginal Effect of Knowledge
	margins, at( (p90) knowl_mean) at( (p10) knowl_mean) post coeflegend
	lincomest _b[1bn._at] - _b[2._at]
	parmest, label saving(traits_margin.dta, replace)
	

*************Process
clear 
use "extreme_process_long.dta"

*****Cleaning
label var id "ID"

label var too_extreme_1 "Both Parties Too Extreme"
label var knowl_mean "Political Knowledge"
label var opinionation "Opinionation"
label var pid_3 "Partisanship"
label var op_ideol_cons "Issue Consistency"
label var ideol_ext "Ideological Extremity"
label var age "Age"
label var gender "Gender"
label var race1 "Race"
label var house_income "Household Income"

gen exp1_cyn = 0 
	replace exp1_cyn = 1 if gil_treat == "counter_lw" | gil_treat == "counter_rw"
label var exp1_cyn "Cynicism Treatment, Exp 1"

gen exp2_cyn = 0
	replace exp2_cyn = 1 if corker_treat == "counter_lw" | corker_treat == "counter_rw"
label var exp2_cyn "Cynicism Treatment, Exp 2"

label def cyntreat 1 "Cynicism Treatment" 0 "No Cynicism Treatment"
label values exp1_cyn exp2_cyn cyntreat

gen cyn1 = . 
	replace cyn1 = 1 if exp1_cyn == 0 & exp2_cyn == 0
	replace cyn1 = 2 if exp1_cyn == 1 | exp2_cyn == 1
	replace cyn1 = 3 if exp1_cyn == 1 & exp2_cyn == 1
label var cyn1 "Cynicism Treatment"
label def cynt1 1 "No Cynicism Treatment" 2 "One Cynicism Treatment" 3 "Two Cynicism Treatments"
label values cyn1 cynt1

label var party "Target Party"

****Model
eststo: logit outcome i.party i.pid_3 c.knowl_mean c.op_ideol_cons i.ideol_ext i.too_extreme_1 c.opinionation ///
				i.gender i.race1 i.educ c.age c.house_income i.cyn1, vce(cluster id)
	
	***Predicted Probability
		margins, at(knowl_mean=(0(0.25)1)) saving(process_probs, replace)
	
	***Marginal Effect of Knowledge
	margins, at( (p90) knowl_mean) at( (p10) knowl_mean) post coeflegend
	lincomest _b[1bn._at] - _b[2._at]
	parmest, label saving(process_margin.dta, replace)
	


/*******************
Table
********************/
	
esttab using "table_oa10.rtf" , ///
	replace onecell label nobaselevels ///
	se b(2) pr2 star(* 0.05 ** 0.01 *** 0.001) ///
	mtitles("Programmatic" "Ideology" "Principles" "Policy" ///
				"S.Groups" "Politicians" "Traits" "Process") ///
	title({\b Table OA10}: Predicting Category Use (Lucid)) ///
	addnotes("Standard errors are clustered at the individual level.")
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	